package com.lx.mobileplayer.utils

import android.util.Log

/**
 * 类说明：log工具类
 * Created by liuxiong on 2019/4/25.
 */
object LogUtil {

    private var isDebug:Boolean=true

    private var tag="------"

    private var currentTag=""

    fun setIsDebug(isDebug:Boolean){
        this.isDebug=isDebug
    }

    fun setCurrentTag(tag:String?){
        this.currentTag= tag ?: ""
    }

    fun d(message:String?){
        message?.let {
            if(isDebug) Log.d(tag+currentTag,message)
        }
    }

    fun i(message:String){
        message?.let {
            if(isDebug) Log.i(tag+currentTag,message)
        }
    }

    fun v(message:String){
        message?.let {
            if(isDebug) Log.v(tag+currentTag,message)
        }
    }

    fun e(message:String){
        message?.let {
            if(isDebug) Log.e(tag+currentTag,message)
        }
    }

    fun w(message:String){
        message?.let {
            if(isDebug) Log.w(tag+currentTag,message)
        }
    }
}